import React from 'react';
import { Link } from 'react-router-dom';

function Header(props) {
    const { routes } = props;

    return <>
        <h1>Pages</h1>
        <ul>
            {routes.map(({ name, path }) => <li key={path}><Link to={path}>{name}</Link></li>)}
        </ul>
    </>;
}

export default React.memo(Header);
